package cn.stylefeng.guns.generator.db;

import cn.stylefeng.guns.generator.modular.entity.CodeDbInfo;
import cn.stylefeng.roses.core.db.DbInitializer;

/**
 * 数据库链接信息表初始化
 *
 * @author fengshuonan
 * @date 2018-07-30-上午9:29
 */
public class DbInfoInitializer extends DbInitializer {

    @Override
    public String getTableInitSql() {
        return "CREATE TABLE code_dbinfo (\n" +
                "  id number(10)  ,\n" +
                "  name varchar2(20) DEFAULT NULL ,\n" +
                "  db_driver varchar2(100) NOT NULL ,\n" +
                "  db_url varchar2(200) NOT NULL ,\n" +
                "  db_user_name varchar2(100) NOT NULL ,\n" +
                "  db_password varchar2(100) NOT NULL ,\n" +
                "  db_type varchar2(10) DEFAULT NULL ,\n" +
                "  create_time date   ,\n" +
                "  update_time date   \n" +
                //"  PRIMARY KEY (`id`) USING BTREE\n" +
                ") ";
               // + "ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='数据库链接信息'";
    }

    @Override
    public String getTableName() {
        return "code_dbinfo";
    }

    @Override
    public Class<?> getEntityClass() {
        return CodeDbInfo.class;
    }
}
